<!doctype html public "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<html>
<head>
<title>
Zapatec Utils Overview
</title>
<link rel ="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script>
function asd() {
	
		parent.document.title="dialog.js Overview";
	
}
</script>
</head>
<body bgcolor="white" onload="asd();">

<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> 	<font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top">
<em>
<b>Zapatec Utils</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<center>
	
	   <h2>dialog.js</h2>
	
</center>

	


<h4>Summary</h4>
<p>
	
		No overview generated for 'dialog.js'<BR/><BR/>
	
</p>

<hr>


    <table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr bgcolor="#CCCCFF" class="TableHeadingColor">
    <td colspan=2><font size="+2">
    
        <b>Class Summary</b>
    
    </font></td>
    </tr>
    
    <tr bgcolor="white" class="TableRowColor">
    <td width="15%"><b><a href="Dialog.html">Dialog</a></b></td>
    <td>&nbsp;</td>
    </tr>
    
    </table>
    <hr/> 


<!-- ========== METHOD SUMMARY =========== -->

<!-- ========== END METHOD SUMMARY =========== -->


        <pre class="sourceview"><span class="comment">// $Id: dialog.js 15736 2009-02-06 15:29:25Z nikolai $</span>
<span class="comment">/*
 * &lt;pre&gt;
 * Copyright (c) 2004-2009 by Zapatec, Inc.
 * http://www.zapatec.com
 * 1700 MLK Way, Berkeley, California,
 * 94709, U.S.A.
 * All rights reserved.
 * &lt;/pre&gt;
 */</span>

<span class="comment">// Though "Dialog" looks like an object, it isn't really an object.  Instead</span>
<span class="comment">// it's just namespace for protecting global symbols.</span>

<span class="reserved">function</span> Dialog(url, name, width, height, action, init) {
	<span class="reserved">if</span> (typeof init == <span class="literal">"undefined"</span>) {
		init = window;	<span class="comment">// pass this window object by default</span>
	}
	Dialog._geckoOpenModal(url, name, width, height, action, init);
};

Dialog._parentEvent = <span class="reserved">function</span>(ev) {
	<span class="reserved">if</span> (Dialog._modal &amp;&amp; !Dialog._modal.closed) {
		Dialog._modal.focus();
		Zapatec.Utils.stopEvent(ev);
	}
};

<span class="comment">// should be a function, the return handler of the currently opened dialog.</span>
Dialog._return = null;

<span class="comment">// constant, the currently opened dialog</span>
Dialog._modal = null;

<span class="comment">// the dialog will read it's args from this variable</span>
Dialog._arguments = null;

Dialog._geckoOpenModal = <span class="reserved">function</span>(url, name, width, height, action, init) {
	var dlg = Zapatec.Utils.newCenteredWindow(url, name, width, height, <span class="literal">'no'</span>);
	Dialog._modal = dlg;
	Dialog._arguments = init;

	<span class="comment">// capture some window's events</span>
	<span class="reserved">function</span> capwin(w) {
		Zapatec.Utils.addEvent(w, <span class="literal">"click"</span>, Dialog._parentEvent);
		Zapatec.Utils.addEvent(w, <span class="literal">"mousedown"</span>, Dialog._parentEvent);
		Zapatec.Utils.addEvent(w, <span class="literal">"focus"</span>, Dialog._parentEvent);
	};
	<span class="comment">// release the captured events</span>
	<span class="reserved">function</span> relwin(w) {
		Zapatec.Utils.removeEvent(w, <span class="literal">"click"</span>, Dialog._parentEvent);
		Zapatec.Utils.removeEvent(w, <span class="literal">"mousedown"</span>, Dialog._parentEvent);
		Zapatec.Utils.removeEvent(w, <span class="literal">"focus"</span>, Dialog._parentEvent);
	};
	capwin(window);
	<span class="comment">// capture other frames</span>
	<span class="reserved">for</span> (var i = 0; i &lt; window.frames.length; capwin(window.frames[i++]));
	<span class="comment">// make up a function to be called when the Dialog ends.</span>
	Dialog._return = <span class="reserved">function</span> (val) {
		<span class="reserved">if</span> (val &amp;&amp; action) {
			action(val);
		}
		relwin(window);
		<span class="comment">// capture other frames</span>
		<span class="reserved">for</span> (var i = 0; i &lt; window.frames.length; relwin(window.frames[i++]));
		Dialog._modal = null;
	};
};
</pre>
	<hr>



<!-- ========== START OF NAVBAR ========== -->
<a name="navbar_top"><!-- --></a>
<table border="0" width="100%" cellpadding="1" cellspacing="0">
<tr>
<td colspan=2 bgcolor="#EEEEFF" class="NavBarCell1">
<a name="navbar_top_firstrow"><!-- --></a>
<table border="0" cellpadding="0" cellspacing="3">
  <tr align="center" valign="top">
  
  
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-summary.html"><font class="NavBarFont1"><b>Overview</b></font></a>&nbsp;</td>
  <td bgcolor="#FFFFFF" class="NavBarCell1Rev">	&nbsp;<font class="NavBarFont1Rev"><b>File</b></font>&nbsp;</td>
  

  <td bgcolor="#FFFFFF" class="NavBarCell1"> <font class="NavBarFont1">Class</font>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="overview-tree.html"><font class="NavBarFont1"><b>Tree</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="index-all.html"--><font class="NavBarFont1"><b>Index</b></font></a>&nbsp;</td>
  <td bgcolor="#EEEEFF" class="NavBarCell1">    <a href="help-doc.html"><font class="NavBarFont1"><b>Help</b></font></a>&nbsp;</td>
  </tr>
</table>
</td>
<td bgcolor="#EEEEFF" align="right" valign="top"><em>
<b>Zapatec Utils</b></em>
</td>
</tr>

<tr>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
&nbsp;PREV&nbsp;
&nbsp;NEXT</font></td>
<td bgcolor="white" class="NavBarCell2"><font size="-2">
  <a href="index.html" target="_top"><b>FRAMES</b></a>  &nbsp;
&nbsp;<a href="overview-summary.html" target="_top"><b>NO FRAMES</b></a>
&nbsp;&nbsp;
<script>
  <!--
  if(window==top) {
    document.writeln('<A HREF="allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
  }
  //-->
</script>
<noscript>
<a href="allclasses-noframe.html" target=""><b>All Classes</b></a>
</noscript>
</font></td>
</tr>
</table>
<!-- =========== END OF NAVBAR =========== -->

<hr>
<font size="-1">

</font>
<div class="jsdoc_ctime">Documentation generated by <a href="http://jsdoc.sourceforge.net/" target="_parent">JSDoc</a> on Thu May 21 12:19:24 2009</div>
</body>
</html>
